/*
 * $Id: NavigationContextMenu.java 56 2009-05-11 10:11:46Z donbeave $
 */

package labour.dbmanager.client.widget;

import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.extjs.gxt.ui.client.widget.menu.MenuItem;
import com.extjs.gxt.ui.client.widget.menu.SeparatorMenuItem;
import com.extjs.gxt.ui.client.widget.tree.Tree;

public class NavigationContextMenu extends Menu {

  private Tree tree;

  private MenuItem refreshItem;
  private MenuItem deleteItem;
  private MenuItem createSchemaItem;
  private MenuItem createTableItem;
  private MenuItem propertiesItem;

  public NavigationContextMenu(Tree tree) {
    this.tree = tree;

    refreshItem = new MenuItem("Refresh");
    deleteItem = new MenuItem("Delete");
    createSchemaItem = new MenuItem("Create Schema");
    createTableItem = new MenuItem("Create Table");
    propertiesItem = new MenuItem("Properties");

    add(refreshItem);
    add(new SeparatorMenuItem());
    add(createSchemaItem);
    add(createTableItem);
    add(new SeparatorMenuItem());
    add(deleteItem);
    add(new SeparatorMenuItem());
    add(propertiesItem);

    tree.setContextMenu(this);
  }

  public MenuItem getRefreshItem() {
    return refreshItem;
  }

  public MenuItem getDeleteItem() {
    return deleteItem;
  }

  public MenuItem getCreateSchemaItem() {
    return createSchemaItem;
  }

  public MenuItem getCreateTableItem() {
    return createTableItem;
  }

  public MenuItem getPropertiesItem() {
    return propertiesItem;
  }

}
